home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sources / libxpm / libxpm34.gz / libxpm34 / xpm-3.4 / lib / XpmWrFFrData.c < prev    next >
C/C++ Source or Header  |  1994-03-14  |  1KB  |  36 lines

  1. /* Copyright 1989-94 GROUPE BULL -- See license conditions in file COPYRIGHT */
  2. /*****************************************************************************\
  3. * XpmWrFFrData.c:                                                             *
  4. *                                                                             *
  5. *  XPM library                                                                *
  6. *  Parse an Xpm array and write a file that corresponds to it.                *
  7. *                                                                             *
  8. *  Developed by Dan Greening dgreen@cs.ucla.edu / dgreen@sti.com              *
  9. \*****************************************************************************/
  10.  
  11. #include "xpmP.h"
  12.  
  13. int
  14. XpmWriteFileFromData(filename, data)
  15.     char *filename;
  16.     char **data;
  17. {
  18.     XpmImage image;
  19.     XpmInfo info;
  20.     int ErrorStatus;
  21.  
  22.     info.valuemask = XpmReturnComments | XpmReturnExtensions;
  23.  
  24.     ErrorStatus = XpmCreateXpmImageFromData(data, &image, &info);
  25.  
  26.     if (ErrorStatus != XpmSuccess)
  27.     return (ErrorStatus);
  28.  
  29.     ErrorStatus = XpmWriteFileFromXpmImage(filename, &image, &info);
  30.  
  31.     XpmFreeXpmImage(&image);
  32.     XpmFreeXpmInfo(&info);
  33.  
  34.     return (ErrorStatus);
  35. }
  36.